#define _CRT_SECURE_NO_WARNINGS 1
#include <string>
#include<algorithm>
using namespace std;
class Solution {
public:
    string reverseStr(string s, int k) {
        int n = s.size();
        for (int i = 0; i < n; i += 2 * k)
        {
            reverse(s.begin() + i, s.begin() + (i + k < n ? i + k : n));
        }
        return s;
    }
};

